home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1320 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.6 KB

  1. Path: news.cyberport.com!usenet
  2. From: tangent@cyberport.com (Warren Young)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Date: Wed, 10 Jan 1996 08:42:45 GMT
  6. Organization: ETR..., Inc.
  7. Message-ID: <4cvu68$2jb@macaw.cyberport.com>
  8. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd <4cf8hf$8fe@hopi.gate.net> <4cgq30$c0v@weck.brokersys.com>
  9. NNTP-Posting-Host: ppp11.cyberport.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. jguthrie@brokersys.com wrote:
  13.  
  14. >It hurts because you have to keep track of the type independantly of the
  15. >actual type declaration.  Having to maintain that information in two places
  16. >means that it won't ever get done.  When you change the type of a variable,
  17. >(and this IS done from time to time even after primary coding is finished,)
  18. >not only do you have to change the declaration, but also all the places where
  19. >that variable appears ....
  20.  
  21. This is one of the reasons HN is useful.  By forcing the programmer to
  22. visit every place that the variable is used, the programmer has an
  23. opportunity to check the semantics of the variable's use.  If the type
  24. of the variable has changed, chances are that the semantics have
  25. changed as well.  How many times have you changed a variable's type to
  26. fix something, only to break something else?
  27.  
  28. >....no matter where it is or the information it gives you
  29. >is wrong. Comments that lie are far worse than no comments at all.  The
  30.  
  31. Of course, and part of the assumption that goes along with HN is that
  32. the programmer is disciplined enough to change the variable name when
  33. the declaration changes.  If you care enough about type errors to fix
  34. it with HN, this assumption is probably correct.  Yes, there are
  35. plenty of people who use HN blindly, and this is unfortunate, but
  36. that's life.
  37.  
  38. >only description of what the code DOES is in the code itself, the comments
  39. >(and other semantically insignificant clues in the program) should describe
  40. >what the program is trying to accomplish, not how it accomplishes it.
  41.  
  42. This is true for comments, because they are logically at a higher
  43. level of abstraction than the rest of the program.  HN works at the
  44. code level, however.  The only time you actually use the information
  45. in the HN prefixes is when you're working with the code itself.
  46.  
  47. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  48. Warren Young <tangent@cyberport.com>  WAS tkennedy@...!
  49.  
  50.